1. Field of the Invention
This invention relates to a method of and a system for carrying out image processing on image data obtained by a color image read-out means such as an image scanner.
2. Description of the Related Art
When a dark picture or a light picture is output from a color image output means such as a printer which is narrow in color reproduction range, jump in brightness occurs in a light part and a chromaticity differentiation loss occurs in a dark part. Conventionally, such jump in brightness and/or chromaticity differentiation loss are prevented by enhancing gradation of an image represented by image data obtained by a color image read-out means such as an image scanner by carrying out contrast enhancement processing on the image data. In the contrast-enhanced image data, color information of the image data is compressed within the color reproduction range of the color image output means so that the color information on the image is held after output of a picture.
As methods of enhancing contrast, there have been known a graylevels mapping method, a histogram equalization method and the like. (See xe2x80x9cHandbook of Image Analysisxe2x80x9d, Tokyo University Publisher) Further, the color compression has been carried out by employing such processing as illustrated in FIG. 8 or 9. In the processing shown in FIG. 8, a color P1 inside the color reproduction range of the image output means is output as it is, and a color P2 outside the color reproduction range is output as a color P2xe2x80x2 which is the closest to the color P2 among colors inside the color reproduction range. In the processing shown in FIG. 8, colors of the original which are inside the color reproduction range of the image output means are faithfully reproduced on the output picture. Accordingly, the processing shown in FIG. 8 is generally referred to as xe2x80x9cfaithful color reproduction compression processingxe2x80x9d. To the contrast, in the processing shown in FIG. 9, a color transformation curve is obtained on the basis of the ratio between the color read-out range of the image read-out means and the color reproduction range of the image output means, and colors are transformed according to the color transformation curve irrespective of whether the color is inside or outside the color reproduction range, e.g., a color P1 inside the color reproduction range is transformed to a color P1xe2x80x2 and a color P2 outside the color reproduction range is transformed to a color P2xe2x80x2 inside the color reproduction range. In accordance with the processing shown in FIG. 9, colors outside the color reproduction range cannot be saturated and a chromaticity differentiation loss cannot occur. Accordingly, the processing shown in FIG. 9 is generally referred to as xe2x80x9cdesaturated color reproduction compression processingxe2x80x9d.
However, when the faithful color reproduction compression processing is carried out on image data having a lot of colors outside the color reproduction range of the image output means, an excessive number of colors are concentrated near the outer periphery of the color reproduction range, whereby a chromaticity differentiation loss occurs with colors in the whole picture. Accordingly, when the image represented by the input image data (which will be referred to as xe2x80x9cthe input imagexe2x80x9d, hereinbelow) is a light image, jump in brightness occurs in a light part of the output picture, and when the input image is a dark image, a chromaticity differentiation loss occurs in a dark part of the output picture. Further when the input image is bright, color saturation occurs in a bright part of the output picture and the appearance of the output picture becomes very unnatural. On the other hand, when desaturated color reproduction compression processing is carried out on image data having a lot of colors inside the color reproduction range of the image output means, chroma of the output picture greatly deteriorates since the color range of the input image is compressed though the image output means is able to faithfully reproduce almost all the colors of the input image.
In order to overcome such a problem, there has been proposed a method in which picture elements of the input image having colors inside the color reproduction range of the image output means are counted and the faithful color reproduction compression processing or the desaturated color reproduction compression processing is selected on the basis of the number of the picture elements having colors inside the color reproduction range. See, for instance, Japanese Unexamined Patent Publication No. 4(1992)-287569.
In the graylevels mapping method and the histogram equalization method, contrast enhancement processing is uniformly carried out over the entire image, and accordingly, when such a method is applied to an image having a part where gradation locally changes, gradation of the part is flattened. Accordingly, when the graylevels mapping method or the histogram equalization method is applied to image data representing an image such as a picture taken against the light where light parts and dark parts are mingled with each other, jump in brightness and/or chromaticity differentiation loss in the output picture can be enhanced.
When the method disclosed in Japanese Unexamined Patent Publication No. 4(1992)-287569 is applied to an image where though picture elements having colors inside the color reproduction range of the image output means are larger in number than those having colors outside the range, the picture elements having colors outside the range are localized in a small region, the faithful color reproduction compression processing is selected. However, if the faithful color reproduction compression processing is carried out on such an image, a chromaticity differentiation loss occurs in the small region. On the other hand, when the method disclosed in Japanese Unexamined Patent Publication No. 4(1992)-287569 is applied to an image where though picture elements having colors outside the color reproduction range of the image output means are larger in number than those having colors inside the range, the picture elements having colors inside the range are localized in a small region, the desaturated color reproduction compression processing is selected. However if the desaturated color reproduction compression processing is carried out on such an image, gradation of the small region deteriorates.
In view of the foregoing observations and description, the primary object of the present invention is to provide a method of and a system for image processing which can process image data representing an image like a picture taken against the light where a dark part or a light part is localized in a small part in the image so that a picture which is visually excellent and free from local jump in brightness or local chromaticity differentiation loss can be output from an image output means having a limited color reproduction range.
In accordance with a first aspect of the present invention, there is provided an image processing method for carrying out image processing on a color image signal which is made up of a plurality of signal components representing respective picture elements and is obtained by a color image read-out means having a limited color read-out range and outputting a processed color image signal to a color image output means having a limited color reproduction range, the method comprising the steps of
counting, for each of the picture elements represented by the color image signal, picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in a predetermined region including the picture element,
generating, according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region, a transformation curve for compressing the color image signal within the color reproduction range of the color image output means,
transforming the color of each picture element on the basis of the transformation curve thus generated, and
outputting a color image signal made up of signal components representing the colors of the picture elements thus transformed to said color image output means as said processed image signal.
It is preferred that the transformation curve be
a first transformation curve on the basis of which a color inside the color reproduction range is not transformed and a color outside the color reproduction range is transformed to a color which is the closest to the color among colors inside the color reproduction range when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region is equal to the total number of the picture elements included in said predetermined region,
a second transformation curve on the basis of which all the colors represented by the color image signal are transformed to colors inside the color reproduction range of the image output means according to the ratio between the color read-out range of the image read-out means and the color reproduction range of the image output means irrespective of whether the color is inside or outside the color reproduction range when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region is 0, and
a third transformation curve which is obtained by interpolation between the first and second transformation curves according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region is larger than 0 and smaller than the total number of the picture elements included in said predetermined region.
For example, the first transformation curve may be a transformation curve employed in the aforesaid faithful color reproduction compression processing and the second transformation curve may be a transformation curve employed in the aforesaid desaturated color reproduction compression processing.
In accordance with a second aspect of the present invention, there is provided an image processing method for carrying out image processing on a color image signal which is made up of a plurality of signal components representing respective picture elements and is obtained by a color image read-out means having a limited color read-out range and outputting a processed color image signal to a color image output means having a limited color reproduction range, the method comprising the steps of
carrying out local contrast enhancement processing on each of the picture elements represented by the color image signal on the basis of the signal components representing the picture elements included in a first predetermined region including the picture element, thereby obtaining a local-contrast-enhanced color image signal made up of signal components representing the respective picture elements subjected to the local contrast enhancement processing,
counting, for each of the picture elements represented by the local-contrast-enhanced color image signal, picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in a second predetermined region including the picture element,
generating, according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region, a transformation curve for compressing the local-contrast-enhanced color image signal within the color reproduction range of the color image output means,
transforming the color of each picture element on the basis of the transformation curve thus generated, and
outputting a color image signal made up of signal components representing the colors of the picture elements thus transformed to said color image output means as said processed image signal.
In the image processing method in accordance with the first or second aspect of the present invention, the xe2x80x9cpredetermined regionxe2x80x9d, the xe2x80x9cfirst predetermined regionxe2x80x9d and the xe2x80x9csecond predetermined regionxe2x80x9d may be, for instance, a square region including therein several picture elements. Further, the expression xe2x80x9cgenerating, according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said (second) predetermined region, a transformation curvexe2x80x9d means to generate, as the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said (second) predetermined region increases, a transformation curve which is closer to the aforesaid faithful color reproduction compression processing and to generate, as the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said (second) predetermined region decreases, a transformation curve which is closer to the aforesaid desaturated color reproduction compression processing, or to generate, when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said (second) predetermined region is larger than a predetermined value, a transformation curve which is substantially equal to the aforesaid faithful color reproduction compression processing and to generate, when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said (second) predetermined region is not larger than the predetermined value, a transformation curve which is substantially equal to the aforesaid desaturated color reproduction compression processing. In this case, a transformation curve obtained by combining, according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said (second) predetermined region, a transformation curve for carrying out the faithful color reproduction compression processing and a transformation curve for carrying out the desaturated color reproduction compression processing is generated.
In the image processing method in accordance with the second aspect of the present invention, it is preferred that the local contrast enhancement processing be processing in which local contrast around each picture element is enhanced by local histogram equalization method based on lightness components of the signal components representing the picture elements included in the first predetermined region.
Further, in the image processing method in accordance with the second aspect of the present invention, it is preferred that the transformation curve be
a first transformation curve on the basis of which a color inside the color reproduction range is not transformed and a color outside the color reproduction range is transformed to a color which is the closest to the color among colors inside the color reproduction range when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region is equal to the total number of the picture elements included in said second predetermined region,
a second transformation curve on the basis of which all the colors represented by the color image signal are transformed to colors inside the color reproduction range of the image output means according to the ratio between the color read-out range of the image read-out means and the color reproduction range of the image output means irrespective of whether the color is inside or outside the color reproduction range when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region is 0, and
a third transformation curve which is obtained by interpolation between the first and second transformation curves according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region is larger than 0 and smaller than the total number of the picture elements included in said second predetermined region.
In accordance with a third aspect of the present invention, there is provided an image processing system for carrying out image processing on a color image signal which is made up of a plurality of signal components representing respective picture elements and is obtained by a color image read-out means having a limited color read-out range and outputting a processed color image signal to a color image output means having a limited color reproduction range, the system comprising
a counter which counts, for each of the picture elements represented by the color image signal, picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in a predetermined region including the picture element,
a transformation curve generator which generates, according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region, a transformation curve for compressing the color image signal within the color reproduction range of the color image output means,
a transformer which transforms the color of each picture element on the basis of the transformation curve generated by the transformation curve generator, and
an output means which outputs a color image signal made up of signal components representing the colors of the picture elements thus transformed to said color image output means as said processed image signal.
In the image processing system in accordance with the third aspect of the present invention, it is preferred that the transformation curve generator generates
a first transformation curve on the basis of which a color inside the color reproduction range is not transformed and a color outside the color reproduction range is transformed to a color which is the closest to the color among colors inside the color reproduction range when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region is equal to the total number of the picture elements included in said predetermined region,
a second transformation curve on the basis of which all the colors represented by the color image signal are transformed to colors inside the color reproduction range of the image output means according to the ratio between the color read-out range of the image read-out means and the color reproduction range of the image output means irrespective of whether the color is inside or outside the color reproduction range when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region is 0, and
a third transformation curve which is obtained by interpolation between the first and second transformation curves according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region is larger than 0 and smaller than the total number of the picture elements included in said predetermined region.
In accordance with a fourth aspect of the present invention, there is provided an image processing system for carrying out image processing on a color image signal which is made up of a plurality of signal components representing respective picture elements and is obtained by a color image read-out means having a limited color read-out range and outputting a processed color image signal to a color image output means having a limited color reproduction range, the system comprising
a local contrast enhancement means which carries out local contrast enhancement processing on each of the picture elements represented by the color image signal on the basis of the signal components representing the picture elements included in a first predetermined region including the picture element, thereby obtaining a local-contrast-enhanced color image signal made up of signal components representing the respective picture elements subjected to the local contrast enhancement processing,
a counter which counts, for each of the picture elements represented by the local-contrast-enhanced color image signal, picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in a second predetermined region including the picture element,
a transformation curve generator which generates, according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region, a transformation curve for compressing the local-contrast-enhanced color image signal within the color reproduction range of the color image output means,
a transformer which transforms the color of each picture element on the basis of the transformation curve generated by the transformation curve generator, and
an output means which outputs a color image signal made up of signal components representing the colors of the picture elements thus transformed to said color image output means as said processed image signal.
In the image processing system in accordance with the fourth aspect of the present invention, it is preferred that the local contrast enhancement means carries out processing in which local contrast around each picture element is enhanced by local histogram equalization method based on lightness components of the signal components representing the picture elements included in the first predetermined region.
Further, in the image processing system in accordance with the fourth aspect of the present invention, it is preferred that the transformation curve generator generates
a first transformation curve on the basis of which a color inside the color reproduction range is not transformed and a color outside the color reproduction range is transformed to a color which is the closest to the color among colors inside the color reproduction range when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region is equal to the total number of the picture elements included in said second predetermined region,
a second transformation curve on the basis of which all the colors represented by the color image signal are transformed to colors inside the color reproduction range of the image output means according to the ratio between the color read-out range of the image read-out means and the color reproduction range of the image output means irrespective of whether the color is inside or outside the color reproduction range when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region is 0, and
a third transformation curve which is obtained by interpolation between the first and second transformation curves according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region when the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region is larger than 0 and smaller than the total number of the picture elements included in said second predetermined region.
In the image processing method in accordance with the first aspect of the present invention and the image processing system in accordance with the third aspect of the present invention, a transformation curve for compressing the color image signal within the color reproduction range of the color image output means is generated according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in a predetermined region including each picture element. The transformation curve is obtained, for instance, by combining a transformation curve for carrying out the faithful color reproduction compression processing and a transformation curve for carrying out the desaturated color reproduction compression processing according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said predetermined region. Accordingly, by transforming the color of each picture element on the basis of the transformation curve generated for the picture element, the color of each picture element is transformed to an optimal color according to the color of the picture elements around the picture element, whereby the color image signal can be compressed without a chromaticity differentiation loss or deterioration in gradation even if colors inside and outside the color reproduction range are locally concentrated in a small region.
In the image processing method in accordance with the second aspect of the present invention and the image processing system in accordance with the fourth aspect of the present invention, local contrast enhancement processing is carried out on each of the picture elements represented by the color image signal on the basis of the signal components representing the picture elements included in a first predetermined region including the picture element and a local-contrast-enhanced color image signal made up of signal components representing the respective picture elements subjected to the local contrast enhancement processing is obtained. Accordingly, as compared with the aforesaid conventional graylevels mapping method or the histogram equalization method, local contrast of an image can be successfully enhanced without jump in brightness and/or chromaticity differentiation loss even if the image is such as a picture taken against the light where light parts and dark parts are mingled with each other. After local contrast of the image is thus enhanced and a local-contrast-enhanced color image signal is obtained, a transformation curve for compressing the local-contrast-enhanced color image signal within the color reproduction range of the color image output means is generated according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in a second predetermined region including each picture element. The transformation curve is obtained, for instance, by combining a transformation curve for carrying out the faithful color reproduction compression processing and a transformation curve for carrying out the desaturated color reproduction compression processing according to the number of picture elements whose colors are inside the color reproduction range of the color image output means out of the picture elements included in said second predetermined region. Accordingly, by transforming the color of each picture element on the basis of the transformation curve generated for the picture element, the color of each picture element is transformed to an optimal color according to the color of the picture elements around the picture element, whereby the color image signal can be compressed without a chromaticity differentiation loss or deterioration in gradation even if colors inside and outside the color reproduction range are locally concentrated in a small region.